package br.com.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name = "MinhaServlet", urlPatterns = {"/oii", "/ola"},
initParams = {
@WebInitParam (name = "param1", value = "Teste com WebInitParam.")}
)
public class TesteServlet2 extends HttpServlet {
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head>");
		out.println("<title>Primeiro Servlet!</title>");
		out.println("</head>");
		out.println("<body>");
		out.println("<h1>Testando o Servlet!!!!!</h1>");
		out.println(getServletConfig().getInitParameter("param1"));
		out.println("</body>");
		out.println("</html>");
		
		
	}
	}